package dk.hewison.client.data;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import dk.hewison.client.domain.Directory;

/**
 * @author John Hewison
 * @author $LastChangedBy: john.hewison $:  $ $LastChangedDate: 2009-02-04 20:02:52 +0000 (Wed, 04 Feb 2009) $:
 * @version $Revision: 360 $:
 */
public interface MediaServer extends RemoteService {


    Directory getDirectory(Directory directory);

    /**
     * @param folderName    The full path to the folder.
     * @param asyncCallback A List of image filenames.
     */
    Directory getDirectoryImageNames(Directory folderName);

    /**
     * Utility/Convenience class.
     * Use MediaServer.App.getInstance() to access static instance of MediaServerAsync
     */
    public static class App {
        private static final MediaServerAsync ourInstance;

        static {
            ourInstance = (MediaServerAsync) GWT.create(MediaServer.class);
            ((ServiceDefTarget) ourInstance).setServiceEntryPoint(GWT.getModuleBaseURL() + "dk.hewison.GetMyStuff/MediaServer");
        }

        public static MediaServerAsync getInstance() {
            return ourInstance;
        }
    }
}
